﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<iss.sg4210.se18.team6s.jass.DAL.Advertisement>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Create
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h2>
        Create</h2>
    <% using (Ajax.BeginForm("Advertisement", new AjaxOptions { }))
       {%>
    <%: Html.ValidationSummary(true)%>
    <fieldset>
        <legend>Fields</legend>
        <div class="editor-label">
            <%: Html.LabelFor(model => model.Title)%>
        </div>
        <div class="editor-field">
            <%: Html.TextBoxFor(model => model.Title)%>
            <%: Html.ValidationMessageFor(model => model.Title)%>
        </div>
        <div class="editor-label">
            <%: Html.LabelFor(model => model.Description)%>
        </div>
        <div class="editor-field">
            <%: Html.TextBoxFor(model => model.Description)%>
            <%: Html.ValidationMessageFor(model => model.Description)%>
        </div>
        <div class="editor-label">
            <%: Html.LabelFor(model => model.ExperienceInYears)%>
        </div>
        <div class="editor-field">
            <%: Html.TextBoxFor(model => model.ExperienceInYears)%>
            <%: Html.ValidationMessageFor(model => model.ExperienceInYears)%>
        </div>
        <div class="editor-label">
            <%: Html.LabelFor(model => model.SalaryFrom)%>
        </div>
        <div class="editor-field">
            <%: Html.TextBoxFor(model => model.SalaryFrom)%>
            <%: Html.ValidationMessageFor(model => model.SalaryFrom)%>
        </div>
        <div class="editor-label">
            <%: Html.LabelFor(model => model.SalaryTo)%>
        </div>
        <div class="editor-field">
            <%: Html.TextBoxFor(model => model.SalaryTo)%>
            <%: Html.ValidationMessageFor(model => model.SalaryTo)%>
        </div>
        <div class="editor-label">
            <%: Html.LabelFor(model => model.StartDate)%>
        </div>
        <div class="editor-field">
            <%: Html.TextBoxFor(model => model.StartDate)%>
            <%: Html.ValidationMessageFor(model => model.StartDate)%>
        </div>
        <div class="editor-label">
            <%: Html.LabelFor(model => model.GeoAreaId)%>
        </div>
        <div id="GeoAreaList" class="editor-field">
        </div>
        <div class="editor-label">
            <%: Html.LabelFor(model => model.CompanyId)%>
        </div>
        <div id="CompanyList" class="editor-field">
        </div>
        <div class="editor-label">
            <%: Html.LabelFor(model => model.IsDeleted)%>
        </div>
        <div class="editor-field">
            <%: Html.EditorFor(model => model.IsDeleted, "Boolean")%>
            <%: Html.ValidationMessageFor(model => model.IsDeleted)%>
        </div>
        <div class="editor-label">
            <%: Html.LabelFor(model => model.IsWithDrawn)%>
        </div>
        <div class="editor-field">
            <%: Html.EditorFor(model => model.IsWithDrawn, "Boolean")%>
            <%: Html.ValidationMessageFor(model => model.IsWithDrawn)%>
        </div>
        <div class="editor-label">
            <%: Html.LabelFor(model => model.IsFulFilled)%>
        </div>
        <div class="editor-field">
            <%: Html.EditorFor(model => model.IsFulFilled, "Boolean")%>
            <%: Html.ValidationMessageFor(model => model.IsFulFilled)%>
        </div>
        <div class="editor-label">
            <%: Html.LabelFor(model => model.AdvertisementTypeId)%>
        </div>
        <div id="AdvertisementTypeList">
        </div>
        <p>
            <input type="submit" value="Create" />
        </p>
    </fieldset>
    <% } %>
    <div>
        <%: Html.ActionLink("Back to List", "Index") %>
    </div>
    <script type="text/javascript">
        $(document).ready(function () {
            $("#GeoAreaList").load("/Advertisement/AdvertisementsGeoAreaList/-1");
        });
        $(document).ready(function () {
            $("#CompanyList").load("/Advertisement/AdvertisementsCompanyList/-1");
        });
        $(document).ready(function () {
            $("#AdvertisementTypeList").load("/Advertisement/AdvertisementsAdvertisementTypeList/-1");
        });
        $(function () {
            $("#StartDate").datepicker({
                altField: "#StartDate",
                altFormat: "DD, d MM, yy"
            });
        });
    </script>
</asp:Content>
